IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_credential_company]') AND TYPE in (N'U'))
BEGIN
CREATE TABLE tb_credential_company
(
    Id INT IDENTITY(1,1) NOT NULL,
    CompanyName varchar(1000) default(''),
    ExhibitionNumber varchar(100) default(''),
    ContactName varchar(100) default(''),
    ContactPhone varchar(100) default(''),
    CredentialCount int default(0),
    CreateBy VARCHAR(100),
    CreateDate DATETIME DEFAULT(GETDATE()),
    UpdateBy VARCHAR(100),
    UpdateDate DATETIME,
	CONSTRAINT PK_tb_credential_company_Id PRIMARY KEY CLUSTERED (Id)
) 
END
GO

IF NOT EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[tb_credential]') AND TYPE in (N'U'))
BEGIN
CREATE TABLE tb_credential
(
    Id INT IDENTITY(1,1) NOT NULL,
    CredentialCompanyId int default(0),
    Name varchar(100) default(''),
    Title varchar(100) default(''),
    PhotoUrl varchar(100) default(''),
    CreateBy VARCHAR(100),
    CreateDate DATETIME DEFAULT(GETDATE()),
    UpdateBy VARCHAR(100),
    UpdateDate DATETIME,
	CONSTRAINT PK_tb_credential_Id PRIMARY KEY CLUSTERED (Id)
) 
END
GO